@extends('common')
@section('content')
<div >
<h3><a href="/manager/addRole">角色添加</a></h3>
 <hr />
<table class="table table-bordered table-hover" width=90%>

    <thead>
    <tr>
	    <th width=50px>角色</th>
        <th width=300px>权限</th>
        <th width=100px>操作</th>
    </tr>
    </thead>
	     @foreach($info as $v)
         <tr id="{{$v['r_id']}}">
		 <td>{{$v['role']}}</td>
         <td>
		 @foreach($v['power'] as $k)
		  {{$k['p_desc']}}、
         @endforeach
		 </td>
         <td><a href="/manager/upRole?id={{$v['r_id']}}">修改</a> | <a href="javascript:void(0)" class='del'>删除</a></td>
         </tr>
		 @endforeach
</table>
</div>

<script type="text/javascript">
$(function(){


   $(".del").click(function(){
   var id=$(this).parent().parent().attr('id');
   var obj=$(this)
   $.ajax({
   type: "get",
   url: "/manager/delRole",
   data: "id="+id,
   success: function(msg){
     obj.parent().parent().remove()
   }
   });
   })
   

})

</script>

@stop